package com.example.project.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.project.common.Result;
import com.example.project.dto.request.ProductRequest;
import com.example.project.dto.request.ProductSearchRequest;
import com.example.project.dto.request.ProductReviewRequest;
import com.example.project.dto.response.ProductResponse;
import com.example.project.dto.response.ProductReviewResponse;
import java.util.List;

public interface ProductService {
    // 商家接口
    Result<?> createProduct(ProductRequest request, Long userId);
    Result<?> updateProduct(Long productId, ProductRequest request, Long userId);
    Result<?> deleteProduct(Long productId, Long userId);
    Result<Page<ProductResponse>> getProductList(Integer pageNum, Integer pageSize, Long userId);
    Result<?> updateProductStatus(Long productId, Integer status, Long userId);

    // 前台接口
    Result<ProductResponse> getProductDetail(Long productId);
    Result<Page<ProductResponse>> searchProducts(ProductSearchRequest request);
    
    // 评价相关
    Result<?> createReview(ProductReviewRequest request, Long userId);
    Result<?> replyReview(Long reviewId, String reply, Long userId);
    Result<Page<ProductReviewResponse>> getProductReviews(Long productId, Integer pageNum, Integer pageSize);
    
    // 收藏相关
    Result<?> favoriteProduct(Long productId, Long userId);
    Result<?> unfavoriteProduct(Long productId, Long userId);
    Result<Page<ProductResponse>> getFavorites(Long userId, Integer pageNum, Integer pageSize);
    Result<Boolean> checkFavorite(Long productId, Long userId);

    // 添加获取分类列表方法
    Result<List<CategoryResponse>> getCategories();

    // 库存相关
    Result<?> updateStock(Long productId, Integer quantity, String type);
    
    // 统计相关
    Result<?> getProductStats(Long productId);
    
    // 推荐相关
    Result<?> getHotProducts(Integer limit);
    Result<?> getNewProducts(Integer limit);
}